export const formatDate = date => {
    if (!(date instanceof Date)) {
        date = new Date(date);
    }
    return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours() >= 10 ? date.getHours() : "0" + date.getHours()}:${date.getMinutes() >= 10 ? date.getMinutes() : "0" + date.getMinutes()}:${date.getSeconds() >= 10 ? date.getSeconds() : "0" + date.getSeconds()}`;
};
export const validEmail = (email) => {
    const emailReg = /^([a-zA-Z]|[0-9])+(\.)?(\w|-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
    return emailReg.test(email);
};